<?php
namespace app\admin\controller;

use thinkless\common\AdminController;
use app\admin\service\RuntimeService;
use app\admin\service\UploadService;

class Upload extends AdminController {

    /**
     * 文件上传
     */
    public function index() {
        $res = UploadService::localUpload();
        return $this->jSuccess([
            'url' => RuntimeService::wrapStaticUrl($res['url']),
            'name' => $res['name']
        ]);
    }
}
